<?php
/**
 * 操作日志类
 * author: heimuya
 * time: 2014-4-15
 */
 namespace Admin\Controller;
 use Think\Controller;
 
class LogController extends CommonController {
	
	public function _initialize(){
		parent::_initialize();
	}
	
	public function oplog(){
		$NL = M('Log');
		$count = $NL->where($where)->count();
		$Page = new \Think\Page($count, 10);
		$nlist = $NL
					->where($where)
					->limit($Page->firstRow. ',' . $Page->listRows)
					->order('time desc')
					->select();
		for($i = 0;$i < count($nlist);$i++){
			$nlist[$i]['location'] = get_location($nlist[$i]['ip']);
		}
		$page = $Page->show();

        $this->assign("page", $page);
		$this->assign('nlist',$nlist);
		$this->display();
	}
}
	